//
//  BaseTabBarController.m
//  LingQianZhu
//
//  Created by 谢英泽 on 2016/12/9.
//  Copyright © 2016年 谢英泽. All rights reserved.
//

#import "BaseTabBarController.h"
#import "AppHeader.h"

@interface BaseTabBarController ()

@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) NSArray *normalImages;
@property (nonatomic, strong) NSArray *selectedImages;

@end

@implementation BaseTabBarController

#pragma mark - *********************生命周期*********************

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self tabBarConfiguration];
    
    [self setupTabBarControllers];
}

#pragma mark - *********************基础配置*********************

/**
 tabbar的基本配置
 */
- (void)tabBarConfiguration {
    self.tabBar.tintColor = kCOLOR_tabBar;
}

/**
 设置控制器
 */
- (void)setupTabBarControllers {
    self.titles         = @[@"首页",@"百科",@"助手",@"我"];
    self.normalImages   = @[@"tabbar_btn_shouye",@"tabbar_btn_purse",@"tabbar_btn_touzi",@"tabbar_btn_wo"];
    self.selectedImages = @[@"tabbar_btn_shouye_down",@"tabbar_btn_purse_down",@"tabbar_btn_touzi_down",@"tabbar_btn_wo_down"];
#if 0
    //首页
    YYHomeController *homeCtrl = [YYHomeController new];
    UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:homeCtrl];
    homeNav.title = self.titles[0];
    homeNav.tabBarItem.image = [[UIImage imageNamed:self.normalImages[0]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    homeNav.tabBarItem.selectedImage = [[UIImage imageNamed:self.selectedImages[0]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    //零钱猪
    YYEncyclopediaController *encyclopediaCtrl = [YYEncyclopediaController new];
    UINavigationController *encyclopediaNav = [[UINavigationController alloc] initWithRootViewController:encyclopediaCtrl];
    encyclopediaNav.title = self.titles[1];
    encyclopediaNav.tabBarItem.image = [[UIImage imageNamed:self.normalImages[1]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    encyclopediaNav.tabBarItem.selectedImage = [[UIImage imageNamed:self.selectedImages[1]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    //投资
    YYHelperController *helperCtrl = [YYHelperController new];
    UINavigationController *helperNav = [[UINavigationController alloc] initWithRootViewController:helperCtrl];
    helperNav.title = self.titles[2];
    helperNav.tabBarItem.image = [[UIImage imageNamed:self.normalImages[2]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    helperNav.tabBarItem.selectedImage = [[UIImage imageNamed:self.selectedImages[2]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    //我
    YYMeController *meCtrl = [YYMeController new];
    UINavigationController *meNav = [[UINavigationController alloc] initWithRootViewController:meCtrl];
    meNav.title = self.titles[3];
    meNav.tabBarItem.image = [[UIImage imageNamed:self.normalImages[3]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    meNav.tabBarItem.selectedImage = [[UIImage imageNamed:self.selectedImages[3]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    self.viewControllers = @[homeNav, encyclopediaNav, helperNav, meNav];
#endif
}

#pragma mark - *********************基础方法*********************


#pragma mark - *********************代理方法*********************


#pragma mark - *********************响应事件*********************


#pragma mark - *********************懒加载*********************


#pragma mark - *********************网络模型*********************

@end
